package com.aaa.service.impl;

import com.aaa.entity.OmsOrder;
import com.aaa.mapper.OrderMapper;
import com.aaa.service.OrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class OrderImpl extends ServiceImpl<OrderMapper, OmsOrder> implements OrderService {

    @Resource
    OrderMapper orderMapper;

    @Override
    public List<Map<String, Object>> selectOrder(Integer id) {
        return orderMapper.selectOrder(id);
    }

    @Override
    public Integer removeOrProduct(String order_sn) {
        return orderMapper.removeOrProduct(order_sn);
    }

    @Override
    public Integer removeOrderId(Integer id,String order_sn) {
        return orderMapper.removeOrderId(id,order_sn);
    }

    @Override
    public Integer updState(String out_trade_no) {
//        System.out.println(out_trade_no);
        return orderMapper.updState(out_trade_no);
    }

    @Override
    public Integer addOrder(String id, String orderid2, String username, String address, String name, String phone, String countPrice) {
        return orderMapper.addOrder(id,orderid2,username,address,name,phone,countPrice);
    }

    @Override
    public Map<String, Object> selectOrderByOrderId(String orderid2) {
        return orderMapper.selectOrderByOrderId(orderid2);
    }

    @Override
    public Map<String, Object> selectCartByOrderId(String s) {
        return orderMapper.selectCartByOrderId(s);
    }

    @Override
    public Integer addOrderItem(String oid, String order_sn, Object product_id, Object product_name, Object price, Object quantity) {
        return orderMapper.addOrderItem(oid,order_sn,product_id,product_name,price,quantity);
    }

    @Override
    public Integer removeCartById(String s) {
        return orderMapper.removeCartById(s);
    }

    @Override
    public List<Map<String, Object>> selectOrderById(String id) {
        return orderMapper.selectOrderById(id);
    }

    @Override
    public Integer removeByOrderSn(String order_sn) {
        return orderMapper.removeByOrderSn(order_sn);
    }
}
